<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box{
            /*子绝父相*/
            position: relative;
            width:600px;
            height:400px;
            background-image: url("/static/w2/images/1.jpg");
            background-position: -40px;

            /*谁想执行过渡动画就给谁加transition*/
            transition:all 0.5s;
        }

        .box .mask{
            position: absolute;
            width:100%;
            height:100%;
            background-color: rgba(0,0,0,0.3);

            transition:all 0.5s;
        }
        .box .p1{
            position: absolute;
            color: white;
            top:250px;
            left:60px;
            font-size: 32px;
            transition:all .5s;


        }
        .box .p2{
            position: absolute;
            top: 300px;
            left:60px;
            color:#96999c;
            /*透明*/
            opacity:0;
            transition:all .5s .1s;
        }
        /*鼠标hover 时的过渡动画*/
        .box:hover{
            background-position: 0;
        }

        .box:hover .mask{
            background-color: rgba(0,0,0,0);
        }
        .box:hover .p1{
            top:200px;
        }
        .box:hover .p2{
            top:260px;
            /*1是完全不透明*/
            opacity: 1;
        }

    </style>
</head>
<body>
<div class="box">
    <!--覆盖层 ,调节图片颜色 ,一个模糊效果-->
    <div class="mask"></div>
    <p class="p1">Nice Lily</p>
    <p class="p2">Lily likes yo play with crayons and pencil</p>
</div>
</body>
</html>